﻿using System;

namespace Ast.Core.Services.Extensions
{
    public class KernelMemoryBlock : IDisposable
    {
        public IDeviceController DeviceController { get; set; }
        public IntPtr Value { get; set; }

        public void Dispose()
        {
            if (DeviceController != null && Value != IntPtr.Zero)
            {
                DeviceController.FreeMemory(Value);
            }
        }
    }
}